home *** CD-ROM | disk | FTP | other *** search
/ Hacker 5 / HACKER05.ISO / Sucelje.cst / 00061_Script_Button - Igre < prev   
Text File  |  1998-03-04  |  10KB  |  242 lines

  1. --Arrow = 0
  2. --I-Beam = 1
  3. --Crosshair = 2
  4. --Crossbar = 3
  5. --Watch = 4
  6. --Blank = 200
  7. --Help = 254
  8. --Finger = 280
  9. --Hand = 260
  10. --Closed Hand = 290
  11. --No Drop Hand = 291
  12. --Copy Closed Hand = 292
  13. --Pencil = 256
  14. --Eraser = 257
  15. --Select = 258
  16. --Bucket = 259
  17. --Lasso = 272
  18. --Dropper = 281
  19. --Air Brush = 301
  20. --Zoom In = 302
  21. --Zoom Out = 303
  22. --Vertical Size = 284
  23. --Horizontal Size = 285
  24. --Diagonal Size = 286
  25.  
  26. property NormalBitmap, RollOverBitmap, SelectedBitmap
  27. property DestinationNormalBitmap, DestinationRollOverBitmap, DestinationSelectedBitmap
  28. property RollOverSound, SelectedSound
  29. property NormalPointer, RollOverPointer, SelectedPointer
  30. property InitialState, ButtonType
  31. property ApplicationPath, DocumentPath, MovieName, MovieMarker
  32. property FrameNumber, MarkerNumber, PlayMode
  33.  
  34.  
  35. on mouseEnter me
  36.   set the member of sprite the spriteNum of me to the member of the RollOverBitmap of me
  37.   set the member of sprite 5 to the member of ("Tekst" && NormalBitmap)
  38.   set the member of sprite 6 to the member of ("Movie" && NormalBitmap)
  39.   cursor the RollOverPointer of me
  40.   puppetSound the RollOverSound of me  
  41. end
  42.  
  43. on mouseDown me
  44.   cursor the SelectedPointer of me
  45.   If (the ButtonType of me) then
  46.     set the member of sprite the spriteNum of me to the member of the SelectedBitmap of me
  47.   else
  48.     set the member of sprite the spriteNum of me to the member of the RollOverBitmap of me
  49.   end if
  50. end
  51.  
  52. on mouseUp me
  53.   cursor the RollOverPointer of me
  54.   puppetSound the SelectedSound of me
  55.   
  56.   If (the ButtonType of me) then
  57.     set the member of sprite the spriteNum of me to the member of the SelectedBitmap of me
  58.   else
  59.     set the member of sprite the spriteNum of me to the member of the RollOverBitmap of me
  60.   end if
  61.   
  62.   if (the PlayMode of me) = #"Return" then
  63.     play done
  64.   else
  65.     if (the ApplicationPath of me) <> EMPTY and (the DocumentPath of me) <> EMPTY then
  66.       open (the DocumentPath of me) with (the ApplicationPath of me)
  67.     else
  68.       if (the DocumentPath of me) <> EMPTY then open (the DocumentPath of me)
  69.     end if
  70.     
  71.     if (the MovieName of me) <> EMPTY and (the MovieMarker of me) <> EMPTY then
  72.       case (PlayMode) of:
  73.         #"Go to":
  74.           go to (the MovieMarker of me) of movie (the MovieName of me)
  75.         #"Play and Return":
  76.           play (the MovieMarker of me) of movie (the MovieName of me)
  77.       end case
  78.     end if
  79.     
  80.     if (the FrameNumber of me) <> 0 then
  81.       case (PlayMode) of:
  82.         #"Go to":
  83.           go to frame (the FrameNumber of me)
  84.         #"Play and Return":
  85.           play frame (the FrameNumber of me)
  86.       end case
  87.     end if
  88.     
  89.     if (the MarkerNumber of me) <> #loop then
  90.       if the PlayMode of me = #"Go to" then
  91.         case (MarkerNumber) of:
  92.           #Previous: go to marker(-1)
  93.           #Loop:     go to marker(0)
  94.           #Next:     go to marker(1)
  95.           otherwise:
  96.             go to MarkerNumber
  97.         end case
  98.       else
  99.         case (MarkerNumber) of:
  100.           #Previous: play marker( -1 )
  101.           #Loop:     play marker(  0 )
  102.           #Next:     play marker(  1 )
  103.           otherwise:
  104.             play MarkerNumber    
  105.         end case
  106.       end if
  107.     end if
  108.   end if
  109. end if
  110. end
  111.  
  112.  
  113. on mouseLeave me
  114. set the member of sprite the spriteNum of me to the member of the NormalBitmap of me
  115. set the member of sprite 5 to member "Tekst"
  116. set the member of sprite 6 to member "Okvir"
  117. cursor the NormalPointer of me  
  118. end
  119.  
  120. on mouseUpOutside me
  121. set the member of sprite the spriteNum of me to the member of the NormalBitmap of me
  122. cursor the NormalPointer of me
  123. end
  124.  
  125.  
  126.  
  127. ---
  128.  
  129. on BeginSprite me
  130. if the currentspritenum = 0 then 
  131. set memdefault = 0 
  132. else
  133. set memref = the member of sprite the currentspritenum
  134. set castlibnum = the castlibnum of memref
  135. set NormalBitmap to the name of member (the membernum of member memref) of castlib castlibnum
  136. end if
  137. end
  138.  
  139. on getPropertyDescriptionList
  140. if the currentspritenum = 0 then 
  141. set memdefault = 0 
  142. else
  143. set memref = the member of sprite the currentspritenum
  144. set castlibnum = the castlibnum of memref
  145.  
  146. set NormalBitmap to the name of member (the membernum of member memref) of castlib castlibnum
  147. set RollOverBitmapDefault to "RollOver" && NormalBitmap
  148.  
  149. set SelectedBitmapDefault to "Selected" && NormalBitmap
  150.  
  151. set RollOverSoundDefault to "RollOver Sound Panel"
  152. set SelectedSoundDefault to "Selected Sound Panel"
  153.  
  154. end if
  155.  
  156. set ButtonPropertyList = [ ¼
  157.            #RollOverBitmap: [ #comment: "RollOver slika:", ¼
  158.                               #format:  #graphic, ¼
  159.                               #default: RollOverBitmapDefault], ¼
  160.            #SelectedBitmap: [ #comment: "Selected slika:", ¼
  161.                               #format:  #graphic, ¼
  162.                               #default: SelectedBitmapDefault], ¼
  163.   #DestinationNormalBitmap: [ #comment: "Normal slika odredisnog spritea:", ¼
  164.                               #format:  #graphic, ¼
  165.                               #default: RollOverBitmapDefault], ¼
  166. #DestinationRollOverBitmap: [ #comment: "RollOver slika odredisnog spritea:", ¼
  167.                               #format:  #graphic, ¼
  168.                               #default: RollOverBitmapDefault], ¼
  169. #DestinationSelectedBitmap: [ #comment: "Selected slika odredisnog spritea:", ¼
  170.                               #format:  #graphic, ¼
  171.                               #default: SelectedBitmapDefault], ¼
  172.             #RollOverSound: [ #comment: "RollOver zvuk:", ¼
  173.                               #format:  #sound, ¼
  174.                               #default: RollOverSoundDefault], ¼
  175.             #SelectedSound: [ #comment: "Selected zvuk:", ¼
  176.                               #format:  #sound, ¼
  177.                               #default: SelectedSoundDefault], ¼
  178.             #NormalPointer: [ #comment: "Normal pointer:", ¼
  179.                               #format:  #cursor, ¼
  180.                               #default: 0], ¼
  181.           #RollOverPointer: [ #comment: "RollOver pointer", ¼
  182.                               #format:  #cursor, ¼
  183.                               #default: 280], ¼
  184.           #SelectedPointer: [ #comment: "Selected pointer:", ¼
  185.                               #format:  #cursor, ¼
  186.                               #default: 290], ¼
  187.              #InitialState: [ #comment: "Pocetno stanje je oznaceno?", ¼
  188.                               #format:  #boolean, ¼
  189.                               #default: FALSE ], ¼
  190.                #ButtonType: [ #comment: "Gumb sa 3 stanja?", ¼
  191.                               #format:  #boolean, ¼
  192.                               #default: FALSE ], ¼
  193.              #DocumentPath: [ #comment: "Otvori dokument (program)...", ¼
  194.                               #format:  #string, ¼
  195.                               #default: ""], ¼
  196.           #ApplicationPath: [ #comment: "...s aplikacijom:", ¼
  197.                               #format:  #string, ¼
  198.                               #default: ""], ¼
  199.                 #MovieName: [ #comment: "Otvori Macromedia film...", ¼
  200.                               #format:  #string, ¼
  201.                               #default: ""], ¼
  202.               #MovieMarker: [ #comment: "...i skoci na oznaku", ¼
  203.                               #format:  #string, ¼
  204.                               #default: ""], ¼
  205.                  #PlayMode: [ #comment: "Play Mode:", ¼
  206.                               #format:  #symbol, ¼
  207.                               #range:   [ #"Go to", #"Play and Return", #"Return" ] , ¼
  208.                               #default: #"Play and Return" ], ¼
  209.               #FrameNumber: [ #comment: "Skoci na frame broj:",¼
  210.                               #format:  #integer, ¼
  211.                               #default: 0 ], ¼
  212.              #MarkerNumber: [ #comment: "Skoci na oznaku:", ¼
  213.                               #format:  #marker, ¼
  214.                               #default: #loop ] ¼
  215.   ]
  216.  
  217. return ButtonPropertyList  
  218.  
  219. end
  220.  
  221.  
  222. on getBehaviorDescription
  223. return ¼
  224. "Switches cast members when the SwitchStates message is received. Switches to a particular state when the SetState message is received. Enter a Group ButtonName to include the current sprite in a group of sprites that respond to the same message. " & RETURN & ¼
  225. "PARAMETERS:" & RETURN & ¼
  226. "ò Item ButtonName - (optional) Enter an item ButtonName to identify the current sprite so that it can receive a specific message. Do not use spaces. Use the ButtonName as an argument for the Message Sprite or Message All Sprites behaviors."  & RETURN & ¼
  227. "ò Alternate Image - number of castmember whose image will replace normal image.  Must be stored in same cast library as Normal castmember."  & RETURN & ¼
  228. "ò Initially Toggled - Turn this option on if sprite's current cast member represents the alternate rather than the normal state of the sprite."  & RETURN & ¼
  229. "ò Group ButtonName - (optional) Enter a Group ButtonName to include the current sprite in a group of sprites that respond to the same message. Do not use spaces. Use the ButtonName as an argument for the Message Sprite or Message All Sprites behaviors."  & RETURN & ¼
  230. "MESSAGES:" & RETURN & ¼
  231. "ò SwitchStates [ID] - Switches the sprite's cast member. ID is the Item ButtonName or Group ButtonName of the sprite. Returns the current state of the sprite, 0 (normal) or 1 (alternate)."& RETURN & ¼
  232. "ò SetState {0 or 1}, [ID] - Sets the sprite to state 0 (normal) or 1 (alternate). ID is the Item ButtonName or Group ButtonName of the sprite. If the ID is omitted any sprite receiving the message will SetState."
  233.  
  234. end
  235.  
  236.  
  237.  
  238. on getAssocMembers --added, fmk
  239. set myPropList = [RollOverBitmap ]
  240.  
  241. return myPropList
  242. end getAssocMembers